﻿namespace DemoService
{
    using System;
    using System.ComponentModel.Composition;
    using System.Linq;
    using System.Text;

    [Export( typeof( IReversinator ) )]
    public class Reversinator : IReversinator
    {
        #region IReversinator Members

        /// <summary>
        /// Method for accepting a string and then reversinating it.
        /// </summary>
        /// <param name="message">The <see cref="String"/> message to reversinate.</param>
        /// <returns>A reversinated <see cref="String"/> value.</returns>
        public String Reversinate( String message )
        {
            var value = message.Reverse();
            var returner = new StringBuilder();

            value.ToList().ForEach( c => returner.Append( c ) );

            return returner.ToString();
        }

        #endregion
    }
}
